<template>
  <div>
    <CategorySelector :disabled="isShow !== 1" />
    <SpuList
      v-if="isShow === 1"
      @setIsShow="isShow = $event"
      @setSpu="spu = $event"
    />
    <SaveSpu
      v-if="isShow === 2"
      @setIsShow="isShow = $event"
      :currentSpu="spu"
    />
    <SaveSku v-if="isShow === 3" @setIsShow="isShow = $event" :spu="spu" />
  </div>
</template>

<script>
import SpuList from './components/SpuList.vue'
import SaveSpu from './components/SaveSpu.vue'
import SaveSku from './components/SaveSku.vue'

export default {
  name: 'Spu',
  data() {
    return {
      /*
        1 显示 SpuList
        2 显示 SaveSpu
        3 显示 SaveSku
      */
      isShow: 1,
      spu: {}
    }
  },
  components: {
    SpuList,
    SaveSpu,
    SaveSku
  }
}
</script>

<style></style>
